<\/div>\n<\/aside>\n\n
This could be a starting point for you. Enter the password and have PowerShell “encrypt” it to a file. When you need it, have PowerShell “decrypt” it.<\/p>\n
There are other techniques I’ve seen, mostly having to do with taking the string and manipulating it in such a way that it can’t be figured out with the eye but the program can read it; take every character and add 10 to it’s ASCII value sort of thing. That I really wouldn’t recommend.<\/p>","upvoteCount":1,"datePublished":"2014-01-15T18:56:28.000Z","url":"https://community.spiceworks.com/t/creating-an-install-script-on-a-locked-down-computer/269152/2","author":{"@type":"Person","name":"chrisseiter","url":"https://community.spiceworks.com/u/chrisseiter"}},"suggestedAnswer":[{"@type":"Answer","text":"
Hey guys,<\/p>\n
We have a group of users that I need to run a flash installer on, the computers are locked down and you need to run any installer as the local admin for it to succeed.<\/p>\n
I’m looking for a way to let a end user run a powershell/cmd script and have that script execute as the local admin, without storing any plain text passwords within the script. Is there a way to do this?<\/p>\n
Thanks.<\/p>","upvoteCount":5,"datePublished":"2014-01-15T18:51:34.000Z","url":"https://community.spiceworks.com/t/creating-an-install-script-on-a-locked-down-computer/269152/1","author":{"@type":"Person","name":"ldelossa","url":"https://community.spiceworks.com/u/ldelossa"}},{"@type":"Answer","text":"
Yeah Im not trying to just cypher-text it, that’s not really secure. This looks like it could be promising, let me research it and see what I can come up with. Thanks!<\/p>","upvoteCount":0,"datePublished":"2014-01-15T18:58:24.000Z","url":"https://community.spiceworks.com/t/creating-an-install-script-on-a-locked-down-computer/269152/3","author":{"@type":"Person","name":"ldelossa","url":"https://community.spiceworks.com/u/ldelossa"}},{"@type":"Answer","text":"
I don’t like the way this is going, security wise, Yes the password is no longer plain text. But if anyone has any sort of working knowledge on how Powershell Works, they can easily decrypt it and have the local Admin password.<\/p>\n
I would suggest installing flash via GPO. and updating via GPO as well. Or use another 3rd party application such as Ninite Pro or PDQ deploy.<\/p>","upvoteCount":3,"datePublished":"2014-01-15T19:08:23.000Z","url":"https://community.spiceworks.com/t/creating-an-install-script-on-a-locked-down-computer/269152/4","author":{"@type":"Person","name":"chamele0n","url":"https://community.spiceworks.com/u/chamele0n"}},{"@type":"Answer","text":"
I am using something called CPAU I’ll create a batch script to call CPAU and execute a CPAU job file which is encrypted.<\/p>\n
But I’m going to caveat that Powershell or any other encryption technique used by all the major products I’ve seen at somepoint have the clear text version of the password. You would have to dig for it and know what you are doing, but it could be compromised in the long run. For me I find it a minor problem and the benefits outweigh the drawbacks. Plus I use a service account, so I can disable, delete, change the password if I need to at any time.<\/p>","upvoteCount":2,"datePublished":"2014-01-15T19:23:08.000Z","url":"https://community.spiceworks.com/t/creating-an-install-script-on-a-locked-down-computer/269152/5","author":{"@type":"Person","name":"alex3031","url":"https://community.spiceworks.com/u/alex3031"}},{"@type":"Answer","text":"
The current version of Flash will self update, we deploy it as an MSI with an MST file enabling the self update. We also deploy Adobe reader and the Spiceworks agent to laptops that way as well, it works very well.<\/p>","upvoteCount":0,"datePublished":"2014-01-15T19:24:33.000Z","url":"https://community.spiceworks.com/t/creating-an-install-script-on-a-locked-down-computer/269152/6","author":{"@type":"Person","name":"alex3031","url":"https://community.spiceworks.com/u/alex3031"}},{"@type":"Answer","text":"
Selp update isn’t a good idea here, since we used in-house software and if flash starts updating itself, it’ll most likely break things.<\/p>\n
I think we ran into an issue doing it through GPO - but I will try this again first, I too would like to the most secure solution, and while I don’t think in 100 years we’ll actually see someone reverse a powershell secure string (not because of complexity of task just because of end user know how) I don’t like to take the chances. I’ll look into this CPAU thing also - looks cool.<\/p>","upvoteCount":0,"datePublished":"2014-01-15T21:31:30.000Z","url":"https://community.spiceworks.com/t/creating-an-install-script-on-a-locked-down-computer/269152/7","author":{"@type":"Person","name":"ldelossa","url":"https://community.spiceworks.com/u/ldelossa"}},{"@type":"Answer","text":"
What I’m thinking about doing is using the file based method, but having the script remove that txt file when it’s done executing, so if the user wanted to run the script again, the get-content would fail, I’ll put a catch in there like, please contact Administrator, get-content failed.<\/p>","upvoteCount":0,"datePublished":"2014-01-15T21:42:06.000Z","url":"https://community.spiceworks.com/t/creating-an-install-script-on-a-locked-down-computer/269152/8","author":{"@type":"Person","name":"ldelossa","url":"https://community.spiceworks.com/u/ldelossa"}},{"@type":"Answer","text":"\n\n
<\/div>\n
louis delossantos:<\/div>\n
\nWhat I’m thinking about doing is using the file based method, but having the script remove that txt file when it’s done executing, so if the user wanted to run the script again, the get-content would fail, I’ll put a catch in there like, please contact Administrator, get-content failed.<\/p>\n<\/blockquote>\n<\/aside>\n
If they were to right click the file and sure “Run with Powershell” that error message would fly by and the windows would close before they could read it. But you could set up emailing in your script to send an email to you if the file is trying to be run without the password file.<\/p>","upvoteCount":0,"datePublished":"2014-01-15T21:45:20.000Z","url":"https://community.spiceworks.com/t/creating-an-install-script-on-a-locked-down-computer/269152/9","author":{"@type":"Person","name":"chamele0n","url":"https://community.spiceworks.com/u/chamele0n"}},{"@type":"Answer","text":"\n\n
<\/div>\n
Chamele0n:<\/div>\n
\n\n\n
<\/div>\n
louis delossantos:<\/div>\n
\nWhat I’m thinking about doing is using the file based method, but having the script remove that txt file when it’s done executing, so if the user wanted to run the script again, the get-content would fail, I’ll put a catch in there like, please contact Administrator, get-content failed.<\/p>\n<\/blockquote>\n<\/aside>\n
If they were to right click the file and sure “Run with Powershell” that error message would fly by and the windows would close before they could read it. But you could set up emailing in your script to send an email to you if the file is trying to be run without the password file.<\/p>\n<\/blockquote>\n<\/aside>\n
You could populate the email with any pertinent information that you may need, like current logged on user, computer name, IP address, etc.<\/p>","upvoteCount":0,"datePublished":"2014-01-15T21:47:35.000Z","url":"https://community.spiceworks.com/t/creating-an-install-script-on-a-locked-down-computer/269152/10","author":{"@type":"Person","name":"chamele0n","url":"https://community.spiceworks.com/u/chamele0n"}},{"@type":"Answer","text":"
Great idea! thanks man.<\/p>","upvoteCount":0,"datePublished":"2014-01-15T21:54:52.000Z","url":"https://community.spiceworks.com/t/creating-an-install-script-on-a-locked-down-computer/269152/11","author":{"@type":"Person","name":"ldelossa","url":"https://community.spiceworks.com/u/ldelossa"}},{"@type":"Answer","text":"
Here’s another question, after having your secure credentials in a variable, how can I open a subshell using those credentials?<\/p>","upvoteCount":0,"datePublished":"2014-01-15T21:58:41.000Z","url":"https://community.spiceworks.com/t/creating-an-install-script-on-a-locked-down-computer/269152/12","author":{"@type":"Person","name":"ldelossa","url":"https://community.spiceworks.com/u/ldelossa"}},{"@type":"Answer","text":"
I think that’s in the link too.<\/p>","upvoteCount":0,"datePublished":"2014-01-15T22:07:37.000Z","url":"https://community.spiceworks.com/t/creating-an-install-script-on-a-locked-down-computer/269152/13","author":{"@type":"Person","name":"chrisseiter","url":"https://community.spiceworks.com/u/chrisseiter"}}]}}
ldelossa
(louis delossantos)
January 15, 2014, 6:51pm
1
Hey guys,
We have a group of users that I need to run a flash installer on, the computers are locked down and you need to run any installer as the local admin for it to succeed.
I’m looking for a way to let a end user run a powershell/cmd script and have that script execute as the local admin, without storing any plain text passwords within the script. Is there a way to do this?
Thanks.
5 Spice ups
chrisseiter
(Chris Seiter (LBFF))
January 15, 2014, 6:56pm
2
This could be a starting point for you. Enter the password and have PowerShell “encrypt” it to a file. When you need it, have PowerShell “decrypt” it.
There are other techniques I’ve seen, mostly having to do with taking the string and manipulating it in such a way that it can’t be figured out with the eye but the program can read it; take every character and add 10 to it’s ASCII value sort of thing. That I really wouldn’t recommend.
1 Spice up
ldelossa
(louis delossantos)
January 15, 2014, 6:58pm
3
Yeah Im not trying to just cypher-text it, that’s not really secure. This looks like it could be promising, let me research it and see what I can come up with. Thanks!
chamele0n
(Chamele0n)
January 15, 2014, 7:08pm
4
I don’t like the way this is going, security wise, Yes the password is no longer plain text. But if anyone has any sort of working knowledge on how Powershell Works, they can easily decrypt it and have the local Admin password.
I would suggest installing flash via GPO. and updating via GPO as well. Or use another 3rd party application such as Ninite Pro or PDQ deploy.
3 Spice ups
alex3031
(Alex3031)
January 15, 2014, 7:23pm
5
I am using something called CPAU I’ll create a batch script to call CPAU and execute a CPAU job file which is encrypted.
But I’m going to caveat that Powershell or any other encryption technique used by all the major products I’ve seen at somepoint have the clear text version of the password. You would have to dig for it and know what you are doing, but it could be compromised in the long run. For me I find it a minor problem and the benefits outweigh the drawbacks. Plus I use a service account, so I can disable, delete, change the password if I need to at any time.
2 Spice ups
alex3031
(Alex3031)
January 15, 2014, 7:24pm
6
The current version of Flash will self update, we deploy it as an MSI with an MST file enabling the self update. We also deploy Adobe reader and the Spiceworks agent to laptops that way as well, it works very well.
ldelossa
(louis delossantos)
January 15, 2014, 9:31pm
7
Selp update isn’t a good idea here, since we used in-house software and if flash starts updating itself, it’ll most likely break things.
I think we ran into an issue doing it through GPO - but I will try this again first, I too would like to the most secure solution, and while I don’t think in 100 years we’ll actually see someone reverse a powershell secure string (not because of complexity of task just because of end user know how) I don’t like to take the chances. I’ll look into this CPAU thing also - looks cool.
ldelossa
(louis delossantos)
January 15, 2014, 9:42pm
8
What I’m thinking about doing is using the file based method, but having the script remove that txt file when it’s done executing, so if the user wanted to run the script again, the get-content would fail, I’ll put a catch in there like, please contact Administrator, get-content failed.
chamele0n
(Chamele0n)
January 15, 2014, 9:45pm
9
louis delossantos:
What I’m thinking about doing is using the file based method, but having the script remove that txt file when it’s done executing, so if the user wanted to run the script again, the get-content would fail, I’ll put a catch in there like, please contact Administrator, get-content failed.
If they were to right click the file and sure “Run with Powershell” that error message would fly by and the windows would close before they could read it. But you could set up emailing in your script to send an email to you if the file is trying to be run without the password file.
chamele0n
(Chamele0n)
January 15, 2014, 9:47pm
10
You could populate the email with any pertinent information that you may need, like current logged on user, computer name, IP address, etc.
ldelossa
(louis delossantos)
January 15, 2014, 9:54pm
11
ldelossa
(louis delossantos)
January 15, 2014, 9:58pm
12
Here’s another question, after having your secure credentials in a variable, how can I open a subshell using those credentials?
chrisseiter
(Chris Seiter (LBFF))
January 15, 2014, 10:07pm
13
I think that’s in the link too.